<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <%@ include file="/WEB-INF/views/include/head.jsp" %>
    <title>在线用户</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<form:form id="searchForm" action="${ctx}/sys/online/list" method="post" class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <div>
        <label>登录名：</label>
        <input id="username" name="username" type="text" maxlength="50" class="input-mini"
               value="${userOnline.username}"/>
        <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
    </div>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-co耗时：ndensed">
    <thead>
    <tr>
        <th>session序号</th>
        <th>用户名</th>
        <th>ip地址</th>
        <th>操作系统</th>
        <th>浏览器</th>
        <th>登录时间</th>
        <th>最后访问时间</th>
        <th>过期时间</th>
        <th>状态</th>
        <th>操作</th>
    </thead>
    <tbody>
    <c:forEach items="${userOnlines}" var="useronline">
        <tr>
            <td>${useronline.id}</td>
            <td>${useronline.username}</td>
            <td>${useronline.host}</td>
            <td>${useronline.os}</td>
            <td>${useronline.browser}</td>
            <td><fmt:formatDate value="${useronline.startTimestamp}" type="both"/></td>
            <td><fmt:formatDate value="${useronline.lastAccessTime}" type="both"/></td>
            <td>${useronline.timeout}</td>
            <c:if test="${useronline.timeout<=0}">
                <td style="color: red">离线</td>
            </c:if>
            <c:if test="${useronline.timeout>0}">
                <td style="color: blue">${useronline.status}</td>
            </c:if>
            <td>
                <a href="${ctx}/sys/online/forceLogout?sessionId=${useronline.id}"
                   onclick="return confirmx('确认要强退该用户吗？', this.href)">强退</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<%--<div class="pagination">${page}</div>--%>
</body>
</html>